<extend name="Public/layout" />
<block name="body">
    <link rel="stylesheet" href="/Public/Wap/css/e.css">
    <link rel="stylesheet" href="/Public/Wap/css/plist.css">
    <script src="/Public/Wap/js/vue.js"></script>
    <script src="/Public/Wap/js/e.js"></script>
    <div id="app" class="panel panel-default panel-intro">
        <div class="panel-heading">
            <ul class="nav nav-tabs" data-field="warping">
                <li class="active"><a>工资结算</a></li>
            </ul>
        </div>
        <div class="panel-body">
            <el-form :model="ruleForms" ref="ruleForms" label-width="100px" size="small" class="search-form-container">
                <el-row class="item-topa top">
                    <el-col :span="5">
                        <el-form-item label="员工">
                            <el-select v-model="ruleForms.mid" clearable placeholder="请选择" style="width:100%">
                                <el-option v-for="item in userList" :key="item.uid" :label="item.nickname"
                                    :value="item.uid">
                                </el-option>
                            </el-select>
                            <!-- <el-input v-model="ruleForms.mid"></el-input> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="5">
                        <el-form-item label="月份">
                            <el-date-picker v-model="ruleForms.report_data" type="month" value-format="yyyy.MM"
                                style="    width: 100%;" placeholder="选择月">
                            </el-date-picker>
                            <!-- <el-input v-model="ruleForms.report_data"></el-input> -->
                        </el-form-item>
                    </el-col>
                    <el-col :span="5"> &nbsp;&nbsp;&nbsp;&nbsp;<el-button type="primary" @click="onSubmit" size="small">
                            查询</el-button>
                    </el-col>
                    <!-- <el-col :span="2">
                        <el-button type="primary" @click="resetForma">清空</el-button>
                    </el-col> -->
                </el-row>
            </el-form>
            <div class="list">
                <el-table :data="list" stripe style="width: 100%">
                    <el-table-column prop="" label="" width="20">
                    </el-table-column>
                    <el-table-column prop="id" label="ID" width="90">
                    </el-table-column>
                    <el-table-column prop="name" label="员工姓名">
                    </el-table-column>
                    <el-table-column prop="report_data" label="月份">
                    </el-table-column>
                    <el-table-column prop="order_num" label="订单数">
                    </el-table-column>
                    <el-table-column prop="yeji" label="付款金额">
                    </el-table-column>
                    <el-table-column prop="settle_money" label="结算金额">
                    </el-table-column>
                    <el-table-column prop="settle_reward" label="结算服务费">
                    </el-table-column>
                    <el-table-column prop="salary" label="工资">
                    </el-table-column>
                    <el-table-column prop="jc_salary" label="基础工资">
                    </el-table-column>
                    <el-table-column prop="tc_salary" label="提成">
                    </el-table-column>
                </el-table>
            </div>
            <div class="page">
                <p class="text fl">每页显示10条，共{{page_count}}条</p>
                <div class="fr">
                    <el-pagination background @current-change='check' layout="prev, pager, next" :total=page_count>
                    </el-pagination>
                </div>
            </div>
        </div>
    </div>
    <div>
        <!-- <div class="title">
            <img src="./img/gz.png" alt=""> <span>工资结算</span>
        </div> -->
    </div>
    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                    ruleForms: {
                        mid: '',
                        report_data: ''
                    },
                    page_count: 0,
                    list: [],
                    userList: [],
                }
            },
            mounted() {
                this.lists(1)
                this.getUserList();
            },
            methods: {
                getUserList() {
                    let that = this;
                    $.post(`/kcadmin/Jd/binderList`, {}, res => {
                        that.userList = res.data;
                    })
                },
                check(i) {
                    console.log('222', i)
                    this.lists(i)
                },
                lists(page) {
                    let data = {
                        page_num: page,
                        page_size: 10,
                        mid: this.ruleForms.mid, //活动id
                        report_data: this.ruleForms.report_data, //活动id
                    }
                    $.post(`/kcadmin/jd/salaryList`, data, res => {
                        this.list = res.data
                        this.page_count = parseInt(res.page_count)
                        console.log(res)
                    })
                },
                onSubmit() { this.lists(1) }
            }
        })
    </script>
    <!-- <link rel="stylesheet" href="./css.css"> -->
    <style>
        .content-wrapper .content-top {
            display: none;
        }

        .fl {
            float: left;
        }

        .fr {
            float: right;
        }

        /* .title {
            line-height: 98px;
            font-weight: 800;
            font-size: 18px;
            margin: 0 60px;
            position: relative;
        }

        .title img {
            width: 22px;
            height: 22px;
            margin-top: 12px;
            margin-right: 16px;
            position: absolute;
            top: 26px;
            left: -36px;
        } */
        .search-form-container .el-form-item {
            margin-bottom: 10px;
        }

        .list {
            /* margin: 0 60px 30px 60px; */
            border: 1px solid #f3f3f3
        }

        .page {
            padding-top: 20px;
            font-size: 14px;
            color: #DB2121;
        }
    </style>
</block>